package com.yunji.common.enums.business;

import java.util.Objects;

/**
 * @Project: yunji-coffee
 * @Package: com.yunji.storage.enums
 * @Title: StorageStatus
 * <p>
 * History:
 * Date                     Version     Author          Summary
 * ============================================================
 * 2024-08-17 13:48:46      V1.0        HuaAo       新建类
 */

public enum  StorageStatus {

    WAIT_STORAGE(1,"待出入库"),
    ALREADY_STORAGE(2,"已出入库"),
    PART_STORAGE(3,"部分出入库"),
    CANCEL_STORAGE(4,"已取消");

    private final Integer code;
    private final String text;

    StorageStatus(Integer code, String text) {
        this.code = code;
        this.text = text;
    }

    public Integer getCode() {
        return code;
    }

    public String getText() {
        return text;
    }

    public static String get(Integer code)
    {
        StorageStatus[] enums = StorageStatus.values();
        for (StorageStatus e: enums )
        {
            if (Objects.equals(e.code, code)) { return e.text; }
        }
        return null;
    }
}